#!/bin/sh

cd "$(dirname "$0")"

mkdir -p build
cd build
CFLAGS=-fPIC CXXFLAGS=-fPIC emcmake cmake -DBUILD_TESTS:BOOL=FALSE -DBUILD_PERF_TESTS:BOOL=FALSE -DBUILD_opencv_apps:BOOL=FALSE -DBUILD_DOCS:BOOL=FALSE -DWITH_TBB:BOOL=TRUE -DWITH_CUDA:BOOL=FALSE -DWITH_IPP:BOOL=FALSE -DWITH_EIGEN:BOOL=FALSE -DOPENCV_EXTRA_MODULES_PATH=$PWD/../../../opencv_contrib/modules -DBUILD_opencv_ts:BOOL=FALSE -DBUILD_opencv_java:BOOL=FALSE -DBUILD_opencv_python2:BOOL=FALSE -DBUILD_opencv_python3:BOOL=FALSE -DBUILD_SHARED_LIBS:BOOL=FALSE -DCMAKE_BUILD_TYPE:String="Release" -DCMAKE_CXX_STANDARD:String="11" -DBUILD_ITT:BOOL=FALSE -DCV_ENABLE_INTRINSICS:BOOL=FALSE -DWITH_OPENCL:BOOL=OFF -DBUILD_JPEG:BOOL=TRUE -DBUILD_PNG:BOOL=TRUE -DEMGU_CV_WITH_TESSERACT:BOOL=FALSE -DEMSCRIPTEN_GENERATE_BITCODE_ST:BOOL=TRUE -DWITH_PTHREADS_PF:BOOL=OFF $PWD/../../..
emmake make cvextern
cd ..
